<?php

namespace app\common\validate;

use app\common\validate\Base;

class MallGoods extends Base
{

    protected $rule = [
        'id|商品ID' => 'require|integer',
        'title|商品名称' => 'require|unique:mall_goods',
        'coin_id|货币类型' => 'require|number',
        'cate_id|商品分类' => 'require|number',
        'price|单价' => 'require|number',
        'score|所得业绩' => 'require|number',
        'credit|积分抵扣' => 'require|integer',
        'unit|单位' => 'require|chs',
        'image|图片' => 'require',
        'total|库存' => 'require|number|min:1,max:9999',
        'city|发货地' => 'require|chs',
    ];

    protected $message = [
    ];

    protected $scene = [
        // 后台新增会员
        'manage_add' => ['title','coin_id','cate_id','price','score','credit','unit','total'],
        // 后台编辑会员
        'manage_edit' => ['title'=>'require','coin_id','cate_id','price','score','credit','unit','total'],
    ];


}